import functools
"""
使用装饰器装饰视图函数, 视图函数的名称一些注释会发生改变
functools.wraps(func)解决
"""

# class Person(object):
#
#     def __eq__(self, other):
#
#         return "查询条件"
#
# if __name__ == '__main__':
#
#     p1 = Person()
#     p2 = Person()
#
#     print(p1 == p2)  # 查询条件
#
#     filter = [1, 3, 4]
#
#     print(filter)  # [1, 3, 4]
#     print(*filter)  # 1, 3, 4


def user_login_data(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):

        pass
    return wrapper


def user_logout_data(func):

    def wrapper(*args, **kwargs):

        pass
    return wrapper


@user_login_data
def index():

    return "index"


@user_logout_data
def news():

    return "news"


if __name__ == '__main__':

    print(index.__name__)  # index
    print(news.__name__)  # wrapper